package edu.zut.main.thread;

public class ThreadDemo5 {

    public static void main(String[] args) {

        //创建的线程默认都是级别为5的线程，可以手动调整优先级   1-10
        //优先级高的线程会优先执行
        Thread thread = new Thread(() -> System.out.println(Thread.currentThread().getName() + " running"), "thread-A");
        Thread thread2 = new Thread(() -> System.out.println(Thread.currentThread().getName() + " running"), "thread-B");

        thread.setPriority(9);
        thread2.setPriority(6);
        thread.start();
        thread2.start();
    }

}
